#include <VBox/vmm/pdmifs.h>

#define NO_THROW __attribute__((nothrow))

int pfnResizeMock(PPDMIDISPLAYCONNECTOR pInterface, uint32_t cBits, void *pvVRAM, uint32_t cbLine,
                                         uint32_t cx, uint32_t cy) NO_THROW {
    return 0;
}


void pfnUpdateRectMock(PPDMIDISPLAYCONNECTOR pInterface, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy) NO_THROW {
    return;
}


void pfnRefreshMock(PPDMIDISPLAYCONNECTOR pInterface) NO_THROW {
    return;
}


void pfnResetMock(PPDMIDISPLAYCONNECTOR pInterface) NO_THROW {
    return;
}


void pfnLFBModeChangeMock(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled) NO_THROW {
    return;
}


void pfnProcessAdapterDataMock(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize) NO_THROW {
    return;
}


void pfnProcessDisplayDataMock(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId) NO_THROW {
    return;
}


int pfnVHWACommandProcessMock(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd, bool fGuestCmd,
                                                     VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd) NO_THROW {
    return 0;
}


int pfnVBVAEnableMock(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId,
                                             struct VBVAHOSTFLAGS RT_UNTRUSTED_VOLATILE_GUEST *pHostFlags) NO_THROW {
    return 0;
}


void pfnVBVADisableMock(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId) NO_THROW {
    return;
}

void pfnVBVAUpdateBeginMock(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId) NO_THROW {
    return;
}


void pfnVBVAUpdateProcessMock(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId,
                                                     struct VBVACMDHDR const RT_UNTRUSTED_VOLATILE_GUEST *pCmd, size_t cbCmd) NO_THROW {
    return;
}


void pfnVBVAUpdateEndMock(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y,
                                                 uint32_t cx, uint32_t cy) NO_THROW {
    return;
}


int pfnVBVAResizeMock(PPDMIDISPLAYCONNECTOR pInterface, PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen,
                                             void *pvVRAM, bool fResetInputMapping) NO_THROW {
    return 0;
}


int pfnVBVAMousePointerShapeMock(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha,
                                                        uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvShape) NO_THROW {
    return 0;
}


void pfnVBVAGuestCapabilityUpdateMock(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fCapabilities) NO_THROW {
    return;
}


void pfnVBVAInputMappingUpdateMock(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy) NO_THROW {
    return;
}


void pfnVBVAReportCursorPositionMock(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fFlags, uint32_t uScreen, uint32_t x, uint32_t y) NO_THROW {
    return;
}


int pfn3DNotifyProcessMock(PPDMIDISPLAYCONNECTOR pInterface, VBOX3DNOTIFY *p3DNotify) NO_THROW {
    return 0;
}

struct PDMIDISPLAYCONNECTOR* CreateDriver() {
    struct PDMIDISPLAYCONNECTOR *res = (struct PDMIDISPLAYCONNECTOR*)malloc(sizeof(PDMIDISPLAYCONNECTOR));
    memset(res, 0, sizeof(PDMIDISPLAYCONNECTOR));
    res->pfnResize = &pfnResizeMock;
    res->pfnUpdateRect = &pfnUpdateRectMock;
    res->pfnRefresh = &pfnRefreshMock;
    res->pfnReset = &pfnResetMock;
    res->pfnLFBModeChange = &pfnLFBModeChangeMock;
    res->pfnProcessAdapterData = &pfnProcessAdapterDataMock;
    res->pfnProcessDisplayData = &pfnProcessDisplayDataMock;
    res->pfnVHWACommandProcess = &pfnVHWACommandProcessMock;
    res->pfnVBVAEnable = &pfnVBVAEnableMock;
    res->pfnVBVADisable = &pfnVBVADisableMock;
    res->pfnVBVAUpdateBegin = &pfnVBVAUpdateBeginMock;
    res->pfnVBVAUpdateProcess = &pfnVBVAUpdateProcessMock;
    res->pfnVBVAUpdateEnd = &pfnVBVAUpdateEndMock;
    res->pfnVBVAResize = &pfnVBVAResizeMock;
    res->pfnVBVAMousePointerShape = &pfnVBVAMousePointerShapeMock;
    res->pfnVBVAGuestCapabilityUpdate = &pfnVBVAGuestCapabilityUpdateMock;
    res->pfnVBVAInputMappingUpdate = &pfnVBVAInputMappingUpdateMock;
    res->pfnVBVAReportCursorPosition = &pfnVBVAReportCursorPositionMock;
    res->pfn3DNotifyProcess = &pfn3DNotifyProcessMock;
    return res;
}
